import { getDictionary } from '@/config/dictionary'

export default function transcode (value: string, name: string, defaultValue?: string) {
  if (!value || !name) return value
  const map = getDictionary(name as any) as any
  return (map && map[value]) || defaultValue || value
}
